package com.firemoss.atonement.frameworks.magicbus
{
	import com.firemoss.magicbus.messaging.fillter.BeforeFilter;
	import com.firemoss.magicbus.messaging.fillter.ResponseFilter;
	
	import mx.rpc.events.ResultEvent;
	
	public class EntityAssemblerFilter extends EntityAssembler implements BeforeFilter, ResponseFilter
	{
		public function before(parameters:Array):Array
		{
			var disassembled : Array = disassemble( parameters )
				
			for ( var i:int=0;i<parameters.length;i++ )
			{
				parameters[i] = disassembled[i]
			}
			
			return parameters;
		}
		
		public function response( result : * ) : *
		{
			var res : * = assemble( result )
				
			return res;
		}
	}
}